define([''],function () {
    return {
        path: '/music',
        name: 'music',
        component: function (resolve) {
            const Foo = {
                template: get('vue/music.vue').responseText,
                data:function () {
                    return{
                        music:'',
                        musicList:{},
                        musicpath:'',
                        musicInfo:{}
                    }
                },
                methods:{
                    findMusic:function () {
                        console.log(this.music);
                        if(this.music != ''){
                            var misuc = post('http://api.he29.com/api.php/music/listd?type=json&limit=12&keyword='+this.music);
                            this.musicList = misuc.responseJSON;
                        }
                    },
                    find:function () {
                      this.findMusic();
                    },
                    lission:function (id) {
                        var misuclink = post('http://api.he29.com/api.php/music/GetMusic?id='+id+'&info=1');
                        this.musicInfo = misuclink.responseJSON;
                        this.musicpath = this.musicInfo.musicLink;
                        console.log(this.musicpath);
                        //src 赋值有点问题~暂时用jq
                        $('#playMusic').attr('src',this.musicInfo.musicLink);
                    }
                },
                created:function () {
                    var id = this.$route.query.id;
                    get.init();
                    console.log(id);
                    var data = localStorage.getItem(id);
                    var obj = eval('(' + data + ')');
                    console.log(obj);
                    localStorage.removeItem(id);
                    console.log(123);
                }
            };
            resolve(Foo);
        }
    }
});